#------------------------------------------------------------ 
#
#       CATM.SMK - NMAKE file to build the EL sample
#				application using the SDS tools
#
# Modification History:
#   #		Date        Who				Comments
#	1.0		DD-MMM-YYYY	VMAC Wizard		Initial Implementaion
#
#-------------------------------------------------------------
#*********************************************************************
#   Copyright (C) 2000-2001 by VeriFone Inc. All rights reserved.
#
# No part of this software may be used, stored, compiled, reproduced,
# modified, transcribed, translated, transmitted, or transferred, in
# any form or by any means  whether electronic, mechanical,  magnetic,
# optical, or otherwise, without the express prior written permission
#                           of VeriFone, Inc.
#*********************************************************************/
#
# Paths
#

# SDS Tools Related Paths
sdsTools = $(SDS)\cmd
SDSIncludes = $(VFSDK)\include


#  App Source Paths
SrcDir = ..\CATM

ACTIncludes = $(ACT2000)\include
VMACIncludes = $(VMAC)\include

#  UCL Include Paths
UCLIncludes = $(UCL)\include
TCPIncludes = $(TCPIP)\include
TCPVerixIncludes = $(TCPIP)\Verixinclude

#  Compiler/Linker/Outhdr Output Paths
ObjDir = ..\CATM\sdsDebug
OutDir = ..\CATM\sdsDebug


# ACT Library Paths
ACTLibraries = $(ACT2000)\lib\sdsShd
ACTLibStatic = $(ACT2000)\output\SDS\files\static\debug

# Library Paths
UCLLibraries = $(UCL)\output\sds\files\static\Debug
#UCLLibraries = $(UCL)\output\sds\files\static\Release
TCPLibraries = $(TCPIP)\output\sds\files\static\Debug
#TCPLibraries = $(TCPIP)\output\sds\files\static\Release


#
# Options for Tools
#

# Compiler Options
Includes = -I$(SDSIncludes) -I$(UCLIncludes) -I$(TCPIncludes) -I$(TCPVerixIncludes) -I$(ACTIncludes) -I$(SrcDir) -I$(VMACIncludes)

# ENABLE THE FOLLOWING LINE IF YOU WANT TO ENABLE LOG_PRINTF MESSAGES IN YOUR APP
COptions = -D__K2__ -D_DEBUG -DLOGSYS_FLAG -f -s int=2 -s sizeof=2 -O d -r a4 -r a5 -o $(@)

# ENABLE THE FOLLOWING LINE IF YOU WANT TO DISABLE LOG_PRINTF MESSAGES IN YOUR APP
#COptions = -D__K2__ -D_DEBUG -f -s int=2 -s sizeof=2 -O d -r a4 -r a5 -o $(@)

linkOptions = -f$(VFSDK)\config\link.spc -d $(VFSDK)\lib\_start.o


#
# Dependencies
#

AppObjects = \
        $(ObjDir)\CATM.o \
		$(ObjDir)\MENU.o \
		$(ObjDir)\USERIF.o \
		$(ObjDir)\MSG.o \
		$(ObjDir)\POBTRAN.o \
		$(ObjDir)\COMM.o \
		$(ObjDir)\PINPAD.o \
		$(ObjDir)\UCLCODE.o


ACTLibs = \
#$(ACTLibraries)\act.slk \
$(UCLLibraries)\ucl.a \
$(TCPLibraries)\vtcpip.a \
$(VFSDK)\lib\libsys.a \
#$(ACT2000)\sdsfiles\libc.a\
$(ACTLibStatic)\act2000.a\
$(VFSDK)\lib\AESlib.a
	
#
#  sample Target Definition
#

pseudoOut : $(OutDir)\CATM.out $(OutDir)\RES\CATM.res
	$(VFSDK)\bin\outhdr -t -s 70000 -h 55000 $(OutDir)\CATM.out
#	$(VFSDK)\bin\outhdr -t -s 10000 -h 2000 -lact.lib=f:/act.lib $(OutDir)\CATM.out

#For 33xx, use the following lines to sign the out and scf file. 
#    	"$(VSFSTOOL)\filesignature" $(OutDir)\CATM.fst -nogui
  $(VFSDK)\bin\FILESIGN -c $(VFSDK)\CONFIG\K2SIGN.CRT -k $(VFSDK)\CONFIG\K2SIGN.KEY -f $(OutDir)\CATM.OUT -s $(OutDir)\CATM.p7s -L

$(OutDir)\CATM.out : $(OutDir)\CATM.odb
  $(sdsTools)\down -F$(VFSDK)\config\down.opt $(OutDir)\CATM.odb -o $(@)

$(OutDir)\CATM.odb : $(AppObjects)
  $(sdsTools)\linker $(linkOptions) $(AppObjects) -y $(ACTLibs) -o $(@)

$(ObjDir)\RES\CATM.res : $(SrcDir)\CATM.rck
  $(DTKTOOLS)\rck2 -S$(SrcDir)\CATM -O$(ObjDir)\RES\CATM -M

######  Compile #######

$(ObjDir)\CATM.o : $(SrcDir)\CATM.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\CATM.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\MENU.o : $(SrcDir)\Menu.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\Menu.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\USERIF.o : $(SrcDir)\UserIf.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\UserIf.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\MSG.o : $(SrcDir)\Msg.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\Msg.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\POBTRAN.o : $(SrcDir)\PobTran.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\PobTran.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\COMM.o : $(SrcDir)\Comm.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\Comm.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\PINPAD.o : $(SrcDir)\Pinpad.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\Pinpad.c | $(DTKTOOLS)\fmterr.exe

$(ObjDir)\UCLCODE.o : $(SrcDir)\uclcode.c 
  $(sdsTools)\cc68000 $(Includes)  -E- $(COptions) $(SrcDir)\uclcode.c | $(DTKTOOLS)\fmterr.exe
